import React, { Component } from 'react'
import Item from '../Item/Item'
import PropTypes from 'prop-types'
import './List.css'

export default class List extends Component {
  static propTypes = {
    changeDone: PropTypes.func.isRequired
  }

  render() {
    const {todos,changeDone,handleDelete} = this.props
    return (
      <ul className="todo-main">
        {
          todos.map(item=>{
            return (
              <Item key={item.id} name={item.name} id={item.id} done={item.done} changeDone={changeDone} handleDelete={handleDelete}/>
            )
          })
        }
        
      </ul>
    )
  }
}


